package com.syedu.cels.factory;

import com.syedu.cels.constants.Iconstants;
import com.syedu.cels.entity.Base;
import com.syedu.cels.entity.Vocabulary;
import com.syedu.cels.entity.Word;

/**
 * @author easonsy
 * @Description
 * @createTime 2022/03/21 23:05:00
 */
public class BaseFactory implements Iconstants {
    public static Base getBase(int type){
        Base base=null;
        if(type==WORD){
            base=new Word();
        }else if(type==VOVABULARY){
            base=new Vocabulary();
        }else{
            throw new IllegalArgumentException("参数不合法...");
        }return base;

    }
}
